package com.blue.seata.order.api.fallback;

import com.blue.seata.order.api.remote.RemoteOrderService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 服务降级处理
 *
 * @author liulei
 * @version 1.0
 */
@Component
public class RemoteOrderServiceFallbackFactory implements FallbackFactory<RemoteOrderService> {

    @Override
    public RemoteOrderService create(Throwable throwable) {
        RemoteOrderServiceFallBackImpl fallBack = new RemoteOrderServiceFallBackImpl();
        fallBack.setCause(throwable);
        return fallBack;
    }
}
